package  
{
	/**
	 * ...
	 * @author Martina Rasch
	 */
	
	import net.flashpunk.Entity;
	import net.flashpunk.FP;
	import net.flashpunk.graphics.Spritemap;
	
	public class ScoreBar extends Entity
	{
		[Embed(source = 'res/scorebar.png')] private const SCORE:Class;
		
		private var score:Spritemap = new Spritemap(SCORE, 200, 50);
		private var record:Boolean;
		
		public function ScoreBar(xOff:int, yOff:int, rec:Boolean = false) 
		{
			record = rec;
			x = xOff;
			y = yOff;
			score.add("show", [0], 20, true); 
			score.add("new", [1], 20, true); 
			
			graphic = score;
		}
		
		override public function update():void {
			super.update();
			if (record) {
				score.play("new");
			} else {
				score.play("show");
			}
		}
		
	}

}